<%= error_messages_for :navigation %>
<table class="form-table">
    <tbody>
        <tr>
            <td width="80px;"><%= t(:a_m_navigation_type)%>：</td>
            <td>
                <input type="radio" checked="checked" value="diy" name="type" onclick="setNav(this.value);">自定義導航<span></span>
                <input type="radio" value="gcategory" name="type" onclick="setNav(this.value);">商品分類<span></span>
                <input type="radio" value="acategory" name="type" onclick="setNav(this.value);">文章分類<span></span>
                <input type="radio" value="bcategory" name="type" onclick="setNav(this.value);">品牌專區<span id="tip_type"></span>
            </td>
        </tr>
        <tr style="display:none;" id="dis_gc">
			<td><%= t(:a_m_navigation_goods_class)%>:</td>
        </tr>
        <tr style="display:none;" id="dis_ac">
			<td><%= t(:a_m_navigation_article_class)%>:</td>
        </tr>
        <tr style="display:none;" id="dis_bc">
			<td><%= t(:a_brand_list)%>:</td>
        </tr>
        <tr>
            <td><%= t(:a_m_navigation_title)%>：</td>
            <td>
                <input type="text" value="" name="title" maxlength="30" id="title" style="width:200px;" class="small-text"><span id="tip_title"></span>
            </td>
        </tr>
        <tr>
            <td><%= t(:a_m_navigation_link)%>：</td>
            <td>
                <input type="text" style="width:200px" value="http://" maxlength="255" name="link" id="link" class="small-text"><span id="tip_link"></span>
            </td>
        </tr>
        <tr>
            <td><%= t(:a_m_navigation_location)%>：</td>
            <td>
                <input type="radio" value="header" checked="checked" name="nav_type">頭部<span></span>
                <input type="radio" value="middle" name="nav_type">中部<span></span>
                <input type="radio" value="footer" name="nav_type">底部<span></span>
            </td>
        </tr>
        <tr>
            <td><%= t(:a_m_navigation_new_open)%>：</td> 
            <td>
                <input type="radio" value="1" name="open_new">是<span></span>
                <input type="radio" value="0" checked="checked" name="open_new">否<span></span>
            </td>
        </tr>
        <tr>
            <td><%= t(:a_news_isshow)%>：</td>
            <td>
                <input type="radio" value="1" checked="checked" name="is_show">是<span></span>
                <input type="radio" value="0" name="is_show">否<span></span>
            </td>
        </tr>
        <tr>
            <td><%= t(:a_m_navigation_sort)%>：</td>
            <td>
                <input type="text" style="width:60px" maxlength="3" value="255" onblur="javascript:if(this.value &gt;255 || this.value &lt;0 ){this.value=255;}" name="sort_order" class="small-text">&nbsp;&nbsp;排序數值範圍:0~255<span></span>
            </td>
        </tr>
    </tbody>
</table>
<script type="text/javascript">
	//设置分类,列表的显示和隐藏
	function setNav(cla){
		var dis_gc=document.getElementById("dis_gc");
		var dis_ac=document.getElementById("dis_ac");
		var dis_bc=document.getElementById("dis_bc");
		if(cla == 'gcategory'){
			//商品分类	
			dis_gc.style.display="";
			dis_ac.style.display="none";
			dis_bc.style.display="none";
	
		}else if(cla == 'acategory'){
			//文章分类
			dis_gc.style.display="none";
			dis_ac.style.display="";
			dis_bc.style.display="none";
	
		}else if(cla == 'bcategory'){
			//品牌分类
			dis_gc.style.display="none";
			dis_ac.style.display="none";
			dis_bc.style.display="";
			
		}else{
			//diy
			dis_gc.style.display="none";
			dis_ac.style.display="none";
			dis_bc.style.display="none";
			setTitleAndLinkByDiy();
		}
	}
</script>